<include file="public@header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <ul class="nav nav-tabs">
            <li><a href="{:url('contact/index',array('id'=>$id))}">联系单</a></li>
            <li class="active"><a href="">新增联系单</a></li>
        </ul>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('doadd')}">


        <div class="form-group">

            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>送审时间
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="date" class="form-control" name="subTime">
            </div>
        </div>

        <div class="form-group">

            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>联系单名称
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="title">
            </div>
        </div>

        <div class="form-group">

            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>描述
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="desc">
            </div>
        </div>

        <div class="form-group">

            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>金额
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="number" class="form-control" name="price">
            </div>
        </div>


        <div class="form-group">

            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>流程完成情况
            </label>
            <div class="col-md-6 col-sm-10">
                <select name="status" class="form-control">
                    <option value=""></option>
                    <option value="1">完成</option>
                    <option value="2">未完成</option>
                    <option value="3">私了</option>
                    <option value="4">作废</option>

                </select>
            </div>
        </div>

        <!-- <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">
                <span class="form-required">*</span>联系单图片
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="file" class="form-control" name="img[]" multiple>
            </div>
        </div> -->

        <div class="form-group">
            <label for="js-smtpsecure" class="col-sm-2 control-label">单据图
            </label>
            <div class="col-md-6 col-sm-10">
                <input type="file" id="imgUpload" name="img[]" multiple accept="image/*" />
                <div id="imgPreviewContainer" class="image-preview-container" style="margin-top: 10px; display: flex; flex-wrap: wrap;"></div>
            </div>
        </div>

        <input type="hidden" name="eid" value="{$id}">
        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                <a class="btn btn-default" href="javascript:history.back(-1);">{:lang('BACK')}</a>
            </div>
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
<script src="__STATIC__/js/image-uploader.js"></script>
<script>
    // 页面加载完成后初始化图片上传组件
    document.addEventListener('DOMContentLoaded', function() {
        // 初始化单据图上传组件
        const imgUploader = new ImageUploader({
            inputId: 'imgUpload',
            previewContainerId: 'imgPreviewContainer',
            fieldName: 'img',
            useDataTransfer: true
        });
    });
</script>
</body>
</html>